package com.ssh.dao.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.ssh.model.ProjectBaseInfo;

public class ProjectBaseInfoDaoImpl extends HibernateDaoSupport {
	public void saveProjectBaseInfo(ProjectBaseInfo ProjectBaseInfo) {
		getHibernateTemplate().save(ProjectBaseInfo);
	}

	public ProjectBaseInfo getProjectBaseInfoById(int id) {
		ProjectBaseInfo ProjectBaseInfo = (ProjectBaseInfo) getSession().createQuery(
				"from ProjectBaseInfo where id = :id").setInteger("id", id).uniqueResult();
		return ProjectBaseInfo;
	}

	public void deleteProjectBaseInfo(ProjectBaseInfo ProjectBaseInfo) {
		getHibernateTemplate().delete(ProjectBaseInfo);
	}

	public List<ProjectBaseInfo> getAllProjectBaseInfos() {
		List<ProjectBaseInfo> ProjectBaseInfoList = getSession().createQuery("from ProjectBaseInfo").list();
		return ProjectBaseInfoList;
	}
	
	public void modifyProjectBaseInfo(ProjectBaseInfo ProjectBaseInfo) {
		getHibernateTemplate().update(ProjectBaseInfo);
	}

}
